#pragma once

#include "trm/twomasks.h"
typedef trm::twomasks_const_sptr TwoMasksConstSPtr;
#include "MaskMode.h"

/// mask with the mode, using which it should be combined
struct MaskWithCombMode {
	TwoMasksConstSPtr mask;
	MaskMode combmode;

	MaskWithCombMode() { }
	MaskWithCombMode(TwoMasksConstSPtr const & mask_, MaskMode const & combmode_)
		: mask(mask_), combmode(combmode_) { }

	bool operator == (MaskWithCombMode const & rhs) const
		{ return mask == rhs.mask && combmode == rhs.combmode; }
	bool operator != (MaskWithCombMode const & rhs) const
		{ return !(*this == rhs); }
};

/// masks collected from all segments for some frame
typedef std::vector<MaskWithCombMode> MasksCollection;

void MergeMasks(BitMask & comp, MasksCollection const & col);
void MergeMasks(GreyMask & comp, MasksCollection const & col);
